<script>
import modal from '@/mixins/modal'
export default {
    name: 'PermissionFormModal',
    mixins: [modal],
    computed: {
        formItem() {
            return this.row
        }
    }
}
</script>
<template>
    <span>
        <IButton click @click="show = true" :type="type" :icon="icon" :perm="perm" :size="size">
          <slot></slot>
        </IButton>
        <Modal v-model="show" :title="title">
            <Form :model="formItem" :label-width="80">
                <Form-item label="名称" prop="name">
                    <Input v-model="formItem.name" placeholder="请输入名称"></Input>
                </Form-item>
                <Form-item label="编码" prop="code">
                    <Input v-model="formItem.code" placeholder="请输入编码"></Input>
                </Form-item>
                <Form-item label="值" prop="description">
                    <Input v-model="formItem.value" placeholder="请输入值"></Input>
                </Form-item>
            </Form>
            <div slot="footer">
                <Button type="text" @click="show = false">取消</Button>
                <Button type="primary" :loading="loading" @click="ok">{{loading ? '拼命中...' :'确定'}}</Button>
            </div>
        </Modal>
    </span>
</template>
